package com.hpeu_12.day1231;

public class TypeConvert {
	public static void main(String[] args) {
		int num = 10;
		long num1 = num;//向上类型转换 自动转换
		Father father = new Son();//多态，就是一种向上类型转换
		System.out.println("-------------------------------");
		double d = 10.5;
		int num2 = (int)d;
		System.out.println(num2);
		Father father2 = new Father();
		Son son = (Son)father2;//向下类型转换
	}
}
class Father{
	
}
class Son extends Father{
	
}